package com.silence.ByteDance;


public class hard_8 {
    public static String solution(String binary1, String binary2) {
        // Please write your code here
        int pow1 = binary1.length() - 1;
        int pow2 = binary2.length() - 1;
        int sum = 0;
        for (String s : binary1.split("")) {
            if (s.equals("1")) {
                sum += Math.pow(2, pow1);
            }
            pow1--;
        }
        for (String s : binary2.split("")) {
            if (s.equals("1")) {
                sum += Math.pow(2, pow2);
            }
            pow2--;
        }
        return String.valueOf(sum);
    }

    public static void main(String[] args) {

        // You can add more test cases here
        System.out.println(solution("101", "110").equals("11"));
        System.out.println(solution("111111", "10100").equals("83"));
        System.out.println(solution("111010101001001011", "100010101001").equals("242420"));
        System.out.println(solution("111010101001011", "10010101001").equals("31220"));
    }
}
